﻿using System;
using System.Web;
using System.Web.Security;

namespace AdminTemplate.Master
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            btnLogout.Click += new EventHandler(btnLogout_Click);
        }

        void btnLogout_Click(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                FormsAuthentication.SignOut();
                FormsAuthentication.RedirectToLoginPage();
            }
        }
    }
}